[%WRAPPER Interface/Page.htm
  title = "Add a Resource"%]
      <table border="0" cellpadding="5" cellspacing="2" width="100%">
        <tr>
          <td><font class="location"><a href="[%system.SCRIPT_URL%]">Index</a> /</font></td>
        </tr>
      </table>
      <table border="0" cellpadding="1" cellspacing="1" width="100%" class="main-border">
        [%form.StartForm(multipart = 1)%]
        <tr class="main-background">
          <td>
            <table border="0" cellpadding="1" cellspacing="0" width="100%">
              <tr>
                <td>
                  <table border="0" cellspacing="1" cellpadding="3" width="100%" class="row-border">
                    <tr class="header">
                      <td>
                        <table border="0" cellspacing="0" cellpadding="1" width="100%">
                          <tr>
                            <td width="2" nowrap></td>
                            <td width="100%"><font class="header">Add a Resource</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>
                  <table border="0" cellspacing="1" cellpadding="3" width="100%" class="row-border">
                    <tr class="body">
                      <td>
                        <table border="0" cellspacing="1" cellpadding="0" width="100%" class="table-border">
                          <tr>
                            <td>
                              <table border="0" cellspacing="1" cellpadding="6" width="100%" class="table">
                                <tr class="table-row">
                                  <td width="100%" colspan="2"><font class="table-row">To add your resource, fill in the required (<font class="form-required">*</font>) fields:<br>[%error%]</font></td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Title <font class="form-required">*</font></font></td>
                                  <td width="100%">[%form.TextBox(name = "FORM_TITLE")%]</td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">URL <font class="form-required">*</font></font></td>
                                  <td width="100%">[%form.TextBox(name = "FORM_URL")%]</td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Category <font class="form-required">*</font></font></td>
                                  <td width="100%">
                                    [%SET options = tools.MapArray({ value = "\${ID}", label = "\${FULL_TITLE}" }, categories)%]
                                    [%form.SelectBox(name = "FORM_CATEGORY", items = options)%]
                                  </td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Description</font></td>
                                  <td width="100%">[%form.TextArea(name = "FORM_DESCRIPTION", rows = 3)%]</td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Keywords <font class="form-required">*</font></font></td>
                                  <td width="100%">[%form.TextArea(name = "FORM_KEYWORDS", rows = 3)%]</td>
                                </tr>
                              [%IF general.IMAGE_UPLOAD || general.IMAGE_URL%]
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Image</font></td>
                                  <td width="100%">
                                    <table border="0" cellpadding="3" cellspacing="0" width="100%">
                                      <tr>
                                        <td width="1" nowrap>[%form.Radio(name = "FORM_IMAGE_TYPE", default = "NONE", value = "NONE")%]</td>
                                        <td colspan="2" width="100%"><font class="form-label">No image.</font></td>
                                      </tr>
                                    [%IF general.IMAGE_URL%]
                                      <tr>
                                        <td width="1" nowrap>[%form.Radio(name = "FORM_IMAGE_TYPE", default = "NONE", value = "URL")%]</td>
                                        <td width="1" nowrap><font class="form-label">URL:</font></td>
                                        <td width="100%">[%form.TextBox(name = "FORM_IMAGE_URL", default = "http://")%]</td>
                                      </tr>
                                    [%END%]
                                    [%IF general.IMAGE_UPLOAD%]
                                      <tr>
                                        <td width="1" nowrap>[%form.Radio(name = "FORM_IMAGE_TYPE", default = "NONE", value = "UPLOAD")%]</td>
                                        <td width="1" nowrap><font class="form-label">Upload:</font></td>
                                        <td width="100%">[%form.FileBox(name = "FORM_IMAGE_UPLOAD")%]</td>
                                      </tr>
                                    [%END%]
                                    </table>
                                  </td>
                                </tr>
                              [%END%]
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Contact Name <font class="form-required">*</font></font></td>
                                  <td width="100%">[%form.TextBox(name = "FORM_CONTACT_NAME")%]</td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Contact Email <font class="form-required">*</font></font></td>
                                  <td width="100%">[%form.TextBox(name = "FORM_CONTACT_EMAIL")%]</td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap></td>
                                  <td width="100%">[%form.CheckBox(name = "FORM_SHOW_EMAIL", value = "1", default = "1")%] <font class="form-label">Show Email?</font></td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap></td>
                                  <td width="100%">[%form.CheckBox(name = "FORM_MAILING_LIST", value = "1", default = "1")%] <font class="form-label">Allow email updates?</font></td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Password <font class="form-required">*</font></font></td>
                                  <td width="100%">[%form.TextBox(name = "FORM_PASSWORD", password = 1)%]</td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">Verify Password <font class="form-required">*</font></font></td>
                                  <td width="100%">[%form.TextBox(name = "FORM_PASSWORD2", password = 1)%]</td>
                                </tr>
                            [%SET publicextra = []%]
                            [%FOREACH field = general.RESOURCE_EXTRA%]
                              [%IF field.PUBLIC%][%publicextra.push(field)%][%END%]
                            [%END%]
                            [%IF publicextra.size >= 1%]
                                <tr class="table-header">
                                  <td colspan="2"><font class="table-header">Extra</font></td>
                                </tr>
                              [%FOREACH field = publicextra%]
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap><font class="form-subject">[%field.DESCRIPTION%][%IF field.REQUIRED%] <font class="form-required">*</font>[%END%]</font></td>
                                [%IF field.CUSTOM%]
                                  <td width="100%"><font class="form-label">[%field.CUSTOM | eval%]</font></td>
                                [%ELSE%]
                                  <td width="100%">[%form.TextBox(name = "FORM_EXTRA_${field.ID}")%]</td>
                                [%END%]
                                </tr>
                              [%END%]
                            [%END%]
                                <tr class="table-row">
                                  <td colspan="2">
                                    <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                      <tr><td height="2" class="table-divider1"></td></tr>
                                      <tr><td height="1" class="table-divider2"></td></tr>
                                    </table>
                                  </td>
                                </tr>
                                <tr class="table-row">
                                  <td width="200" valign="top" nowrap></td>
                                  <td width="100%">[%form.Button(type = "submit", value = "Add")%] [%form.Button(type = "reset", value = "Cancel")%]</td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>
                  <table border="0" cellspacing="1" cellpadding="3" width="100%" class="row-border">
                    <tr class="bottombar">
                      <td><font class="bottombar"></font></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        [%form.Hidden(name = "action", value = "DoAdd")%]
        [%form.EndForm()%]
      </table>
[%END%]